#pragma once
#include <ostream>

namespace krryn{
namespace math{
	template<typename _Tx, typename _Tag>
	class vector2{
	public:
		union{
			struct{ _Tx m_X, m_Y; };
			struct{ _Tx m_U, m_V; };
			struct{ _Tx m_Width, m_Height; };
		};

		vector2() : m_X(0), m_Y(0) {}
		vector2(_Tx a_X, _Tx a_Y) : m_X(a_X), m_Y(a_Y) {}

		vector2 operator-(const vector2 &a_Other){
			return vector2(
				m_X - a_Other.m_X,
				m_Y - a_Other.m_Y
			);
		}
	};

	struct uv_tag {};
	struct point_tag_2 {};
	struct size_tag {};

	typedef vector2<float, uv_tag> uv;
	typedef vector2<int, point_tag_2> point;
	typedef vector2<int, size_tag> size;

	template<typename _Type, typename _Tag>
	std::ostream& operator<<(std::ostream& a_Stream, const vector2<_Type, _Tag> &a_Vector){
		return a_Stream << '[' << a_Vector.m_X << ", " << a_Vector.m_Y << ']';
	}
}
}
